[[ package gen;

import se.rupy.http.*;
import se.rupy.sprout.*;
import se.rupy.content.*;

public class index extends Sprout {
	public int index() { return 1; }
	public String path() { return "/"; }
	public void filter(Event event) throws Event, Exception {
		Output out = event.output();
		String key = (String) event.session().get("key"); ]]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Sprout</title>
  <link rel="stylesheet" type="text/css" href="res/sprout.css"/>
  <link rel="alternate" type="application/rss+xml" href="feed?rss=true"/>
  <link rel="alternate" type="application/atom+xml" href="feed?atom=true"/>
  <script type="text/javascript" src="res/drag.js"></script>
  <script type="text/javascript" src="res/sprout.js"></script>
  <script type="text/javascript" src="res/cufon.js"></script>
  <script type="text/javascript" src="res/EasyScript.js"></script>
  <!--[if gte IE 9]>
  <script type="text/javascript">
    Cufon.set('engine', 'canvas');
  </script>
  <![endif]-->
  <script type="text/javascript">
    Cufon.replace('h2');
  </script>
  <script type="text/javascript">
    function init() {
      document.forms[0].elements[0].focus();
      size();
    }
    function size() {
      columnize([[ key == null ? "140" : "240" ]]);
    }
  </script>

[[ if(event.daemon().archive("talk") != null) { ]]

  <!-- copy this --><!-- start -->
  
  <link rel="stylesheet" type="text/css" href="res/talk.css"></link>
  <script type="text/javascript" src="res/talk.js"></script>
  <script type="text/javascript">
    function talk() {
      setTimeout("start('res/')", 100); // XHR
      //setTimeout("start('res/', 'localhost:8000', 'talk')", 100); // XSS
      init();
    }
    function filter(message) {
      if(message.text.indexOf('#code') == 0) {
        return true;
      }
      return false;
    }
  </script>
  
  <!-- stop --><!-- copy this -->
  
[[ } ]]

[[ String analytics = System.getProperty("analytics");
   if(analytics != null) { ]]

  <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '[[ analytics ]]']);
    _gaq.push(['_trackPageview']);
    (function() {
      var ga = document.createElement('script');
      ga.src = 'http://www.google-analytics.com/ga.js';
      ga.setAttribute('async', 'true');
      document.documentElement.firstChild.appendChild(ga);
    })();
  </script>

[[ } ]]

</head>

[[ if(event.daemon().archive("talk") != null) { ]]

<!-- copy this --><!-- start -->

<body onload="talk();" onbeforeunload="stop();">

<!-- stop --><!-- copy this -->

[[ } else { ]]

<body onload="init();">

[[ } ]]

<div id="page" class="page">
  <div style="float: right;">

[[ if(key == null) {
	event.daemon().chain(event, "/login").filter(event);
}
else {
	event.daemon().chain(event, "/publish").filter(event);
} ]]

  </div>
  <div id="content" onResize="size();">

[[ event.daemon().chain(event, "/content").filter(event); ]]

  </div>
  <span class="clear"></span>

[[ event.daemon().chain(event, "/footer").filter(event); ]]

</div>

[[ if(event.daemon().archive("talk") != null) { ]]

<!-- copy this --><!-- start -->

<div>
  <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1" height="1">
    <param name="allowscriptaccess" value="always"/>
    <param name="movie" value="sound.swf"/>
    <embed src="sound.swf" swliveconnect="true" width="1" height="1" name="player" type="application/x-shockwave-flash">
    </embed>
  </object>
</div>

<div id="blob" class="fixed">
  <div id="toggle" style="overflow: hidden; height: 100%;"></div>
</div>

<div id="spur" class="fixed">
  <img src="res/cone.gif">
</div>

<!-- stop --><!-- copy this -->

[[ } ]]

<script type="text/javascript"> Cufon.now(); </script>

</body>
</html>

[[ } 
} ]]

